define(function(require, exports, module){
	require("resource/js/easyui/themes/icon.css");
	require("resource/js/easyui/easyloader.js");
	var AJAX = require("resource/js/component/ajax.js");
	var EUtil = require("resource/js/component/easyutil.js");
	var EC = require("resource/js/component/easycombobox.js");
	var dgutil = undefined;
	var config = {
			name:"监控列表",
			column:[[
                    {field:'id',title:'主键ID',width:100,align:'center',height:50,hidden:true},
                    {field:'createTime',title:'时间',width:60,align:'center',height:50,hidden:false},
                    {field:'alarmType',title:'报警类型',width:120,align:'center',height:50,hidden:false,
						formatter: function (value, row) {
							if(value == undefined || value ==''){
								return '';
							}
							var val=value.length > 30?value.substring(0, 30)+'...':value;
							return "<span title='" + value + "'>" + val + "</span>";
						}
					},
                    {field:'oilstoneRatio',title:'油石比',width:60,align:'center',height:50,hidden:false},
                    {field:'temperature1',title:'温度1',width:60,align:'center',height:50,hidden:false},
                    {field:'temperature2',title:'温度2',width:60,align:'center',height:50,hidden:false},
                    {field:'temperature3',title:'温度3',width:60,align:'center',height:50,hidden:false},
                    {field:'alarmInfo',title:'报警信息',width:120,align:'center',height:50,hidden:false,
						formatter: function (value, row) {
							if(value == undefined || value ==''){
								return '';
							}
							var val=value.length > 30?value.substring(0, 30)+'...':value;
							return "<span title='" + value + "'>" + val + "</span>";
						}
					},
            ]]
	}
	
	var initpage = function(){

		var sectionId = sessionStorage.getItem('sectionId');  //获取标段id
		if(sectionId == null){
			sectionId = 0;
		}
		$("#searchSectionId").val(sectionId);
		AJAX.init().success(function(code,msg,data){
			EC.init({ ele:"#blenderIdSearch",valueField:'blendId',remote:true, textField:'blendName',}).load(data);
		}).error(function(code,msg,data){
		}).post(BASEPATH+'/dcs/asphalt/device/findBlenderBySectionId.htm',{sectionId:sectionId});

		dgutil = EUtil.ajaxDataGrid(datagridconfig);
	}

	module.exports = {
			trans:function(){
				var buttons={
						title:{
							_class:"",
							text:"监控列表"
							
						},
						btn:[{
								 iconCls:"icon-search",
								 text:"查询",
								 //addClass:"l-btn-display",
								 url:"/dcs/asphalt/asphaltAlarm/queryAsphaltAlarmByPage.htm",
								 handler: function(){dgutil.pager(1);}
						     }
						]};
				datagridconfig = {
						fitColumns:true,
						singleSelect:false,
						striped:true,
						autoRowHeight:false,
						fit: true,
						toolbar:buttons,
						columns:config.column,
						eid:"dg",
						url:BASEPATH+'/dcs/asphalt/asphaltAlarm/queryAsphaltAlarmByPage.htm',
						args:"searchform"
				};
				
				using(["parser","dialog","datagrid" ,"combo","combobox"],function(){
					initpage();
				});
			}
	}
});
